﻿#ifndef PIDFUC_H
#define PIDFUC_H

#include <QObject>
struct tagPid
{
    float value_p = 1;
    float value_i = 1;
    float value_d = 1;

    float target;
    float outputLimit;

    float sum_error;
    float sum_errorLimit;

    float last_error;
    float delta_error;

};

class pidFuc : public QObject
{
    Q_OBJECT
public:
    explicit pidFuc(QObject *parent = nullptr);

    void setPidTag(float p,float i,float d,float target,float maxOut);

    float pidControl(float value,float time);

    tagPid tag;
private:


signals:
};


#endif // PIDFUC_H
